<template>
    <div class="flightDateTwo">
      <date :tipDivText='tipDivText' @dateClick="dateClick" @dateBack="dateBack"  :max="max" :openTime="openTime"></date>
    </div>
</template>

<script>
  import date from 'components/date.vue';

   export default{
     data(){
       return{
         back:'',
         tipDivText:'',
       }
     },
     mounted(){
       this.back = this.$route.params.back;
       if(this.$route.params.goal){
//         this.tipDivText = this.$route.params.goal;
         this.goal = this.$route.params.goal;
       }
     },
     methods:{
       dateBack(){

       },
       dateClick(msg){
         console.log(msg)
         this.$router.go(-1);
         this.$router.replace({
           name:this.back,
           params:{
             date:msg,
             dateBack:this.goal
           }
         })
       }
     },
     computed:{
//       min(){
//         return this.$store.state.flight.fromDate
//       },
       max(){
         var k = '364'.future();
         return k ;
       },
       openTime(){
         if(this.$route.params.goal == '返程'){
           this.$store.state.flight.openTime=this.$store.state.flight.returnTimes;
         }else {
           this.$store.state.flight.openTime=this.$store.state.flight.fromDate;
         }
         return this.$store.state.flight.openTime
       }

     },
     watch:{},
     components:{date},
   }
</script>
